package com.we823.utils.web;

import java.util.ArrayList;
import java.util.List;

import org.apache.commons.lang3.StringUtils;

public class StringUtil {
	public static void toIntegerList(String original,List<Integer> finalIntegerList) {
		String[] stringArray = StringUtils.split(original, ",");
		if (finalIntegerList==null) {
			finalIntegerList = new ArrayList<Integer>();
		}
		if(stringArray!=null && stringArray.length>0) {
			for (String originalString : stringArray) {
				if(StringUtils.isNumeric(originalString)) {
					finalIntegerList.add(Integer.parseInt(originalString));
				}
			}
		}
	}
}
